1. Field of the Invention
This invention pertains in general to image processing and in particular to compressing, decompressing, and scaling images.
2. Description of Background Art
The Joint Photographic Expert Group (JPEG) standard is widely used to compress digitized gray scale and full color images. Most implementations of JPEG use "lossy" compression to achieve an increase in compression in return for a decrease in image quality. The amount of compression can be adjusted and the size of an image compressed using JPEG can be reduced by 10-15 times without noticeable loss in image quality. Accordingly, many of the stored images used in computer systems are compressed using JPEG.
However, the steps involved in compressing and decompressing a JPEG image are computationally intensive. FIG. 1 is a block diagram illustrating the functional units of a prior art JPEG encoder 100. The source image 110 is received by a discrete cosine transform (DCT) coder 112. The output of the coder 112 is provided to a quantizer 114. The output of the quantizer 114 is provided to a Huffman encoder 116. The output of the Huffman encoder 116 is stored as a JPEG image 118.
In operation, the source image 110 is divided into 8.times.8 blocks of pixels. The DCT coder 112 receives the 8.times.8 blocks and transforms each one using a forward DCT (FDCT). The FDCT produces a set of 64 DCT coefficients for each 8.times.8 block. The quantizer 114 quantizes each of the 64 coefficients using one of 64 corresponding values stored in a quantization table 120. The values in the quantization table are specified by the particular JPEG encoding application and may be customized to affect particular image characteristics. In addition, the quantization table is stored with the JPEG image 118 to assist in decoding. After quantization, the quantized coefficients are passed to the Huffman encoder 116. The Huffman encoder 116 uses values stored in Huffman tables 122 to compress the quantized coefficients. The Huffman encoded quantized coefficients are stored as the JPEG image 118. In addition, the Huffman tables 122 are stored in the JPEG image 118.
FIG. 2 is a block diagram illustrating a prior art JPEG decoder 200. Shown are the JPEG image 118, a Huffman decoder 210, a dequantizer 212, an inverse discrete cosine transform (IDCT) coder 214, and an output image 216. Each unit illustrated in FIG. 2 essentially performs the reverse of its corresponding unit in FIG. 1. The Huffman decoder 210 uses Huffman tables 211 extracted from the JPEG image 118 to decode the quantized DCT coefficients. The dequantizer 212 uses quantization tables 213 extracted from the JPEG image 118 to dequantize the cosine coefficients. After dequantization, the DCT coefficients are transformed into an 8.times.8 block of samples by the DCT coder 214. The 8.times.8 blocks of samples are combined into the output image 216. Complete descriptions of the JPEG encoding and decoding processes are found in William B. Pennebaker and Joan L. Mitchell, JPEG Still Image Data Compression Standard, Van Nostrand Reinhold, 1993, which is hereby incorporated by reference herein.
Often, there is a desire to scale the resolution of an image. Sometimes, it is desirable to display a JPEG image at a lower resolution than it is stored, such as when generating small thumbnail images from a large number of source images. Existing techniques for such scaling are inefficient in that the techniques waste processing resources. A common technique, for example, is to decode the full JPEG image and then apply a scaling algorithm to reduce the size of the decoded image. This technique, however, is processing resource inefficient because it must scale the image after it has been fully decoded. In addition, such expansion can result in spectral distortion due to image aliasing.
Similarly, it is sometimes desirable to store a JPEG image at a higher resolution than that of the source image. For example, some output devices, such as facsimile machines, accept input at only certain resolutions, such as 200 dots per inch (DPI). When compressing a source image having a smaller resolution, such as 100 DPI, that will be sent to such a device, it is desirable to increase the resolution of the resulting JPEG image. In this manner, the image produced by the output device will appear normal-sized.
A common technique for increasing resolution of an image is to JPEG encode the source image at its original resolution and then expand the image upon decoding. Such expansions, however, result in inferior image quality due to blocking artifacts.
Therefore, there is a need for a system and method of scaling JPEG images that is processing resource-efficient and does not result in image aliasing or blocking.